﻿Imports Spring.Transaction.Interceptor
Imports Spring.Transaction

<Serializable()> _
Public Class Endereco
    Inherits BaseDominio

    Private _logradouro As String
    Public Overridable Property Logradouro() As String
        Get
            Return _logradouro
        End Get
        Set(ByVal value As String)
            _logradouro = value
        End Set
    End Property

    Private _numero As String
    Public Overridable Property Numero() As String
        Get
            Return _numero
        End Get
        Set(ByVal value As String)
            _numero = value
        End Set
    End Property

    Private _complemento As String
    Public Overridable Property Complemento() As String
        Get
            Return _complemento
        End Get
        Set(ByVal value As String)
            _complemento = value
        End Set
    End Property

    Private _bairro As String
    Public Overridable Property Bairro() As String
        Get
            Return _bairro
        End Get
        Set(ByVal value As String)
            _bairro = value
        End Set
    End Property

    Private _cidade As String
    Public Overridable Property Cidade() As String
        Get
            Return _cidade
        End Get
        Set(ByVal value As String)
            _cidade = value
        End Set
    End Property

    Private _uf As String
    Public Overridable Property UF() As String
        Get
            Return _uf
        End Get
        Set(ByVal value As String)
            _uf = value
        End Set
    End Property

    Private _CEP As String
    Public Overridable Property CEP() As String
        Get
            Return _CEP
        End Get
        Set(ByVal value As String)
            _CEP = value
        End Set
    End Property

#Region "Negocio"

    Public Sub New()
        MyBase.New()
    End Sub

    Public Overridable Function Buscar(ByVal _id As Long) As Endereco
        Return MyBase.EnderecoDao.Buscar(_id)
    End Function

    <Transaction(TransactionPropagation.Required)> _
    Public Overridable Sub Salvar()
        MyBase.EnderecoDao.Salvar(Me)
    End Sub

#End Region

End Class